package com.huawei.appgallery.forum.section.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.css.CSSRule;
import com.huawei.appgallery.foundation.ui.css.CSSSelector;
import com.huawei.appgallery.foundation.ui.css.CSSStyleSheet;
import com.huawei.appgallery.foundation.ui.css.CSSView;
import com.huawei.appgallery.foundation.ui.framework.uikit.ContractFragment;
import o.bqx;
import o.brz;
import o.bse;
import o.cab.e;
import o.cab.i;

public class ForumSectionClosedFragment extends ContractFragment {
    protected String ˋ;
    protected String ˏ;
    protected int ॱ;

    public void ˏ(Bundle bundle) {
        try {
            Bundle ˊॱ = ˊॱ();
            this.ˋ = ˊॱ.getString("key_css");
            this.ˏ = ˊॱ.getString("key_cssselector");
            this.ॱ = ˊॱ.getInt("key_style");
        } catch (Exception e) {
            bqx.ˋ("ForumSectionClosedFragm", "onCreate error");
        }
        super.ˏ(bundle);
    }

    public View ˋ(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        super.ˋ(layoutInflater, viewGroup, bundle);
        ViewGroup viewGroup2 = (ViewGroup) layoutInflater.inflate(i.ͺ, viewGroup, false);
        brz ॱ = bse.ˏ.ॱ(400001);
        viewGroup2.findViewById(e.ᐝˊ).setBackgroundResource(ॱ.ˋ());
        ((TextView) viewGroup2.findViewById(e.ˎ)).setText(ॱ.ˎ());
        if (this.ॱ == 1) {
            ˋ(viewGroup2);
        }
        return viewGroup2;
    }

    private void ˋ(View view) {
        if (this.ˋ != null && this.ˏ != null && view != null) {
            CSSSelector cSSSelector = new CSSSelector(this.ˏ);
            CSSStyleSheet parse = CSSStyleSheet.parse(this.ˋ);
            if (parse != null) {
                CSSRule rule = cSSSelector.getRule(parse.getRootRule());
                if (rule != null) {
                    CSSView.wrap(view, rule).render();
                }
            }
        }
    }
}
